Left Termination of the query pattern color_map_in_2(a, g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

color_map(.(Region, Regions), Colors) :- ','(color_region(Region, Colors), color_map(Regions, Colors)).
color_map([], Colors).
color_region(region(Name, Color, Neighbors), Colors) :- ','(select(Color, Colors, Colors1), members(Neighbors, Colors1)).
select(X, .(X, Xs), Xs).
select(X, .(Y, Ys), .(Y, Zs)) :- select(X, Ys, Zs).
members(.(X, Xs), Ys) :- ','(member(X, Ys), members(Xs, Ys)).
members([], Ys).
member(X, .(X, X1)).
member(X, .(X1, T)) :- member(X, T).
test_color(Name, Map) :- ','(map(Name, Map), ','(colors(Name, Colors), color_map(Map, Colors))).
map(test, .(region(a, A, .(B, .(C, .(D, [])))), .(region(b, B, .(A, .(C, .(E, [])))), .(region(c, C, .(A, .(B, .(D, .(E, .(F, [])))))), .(region(d, D, .(A, .(C, .(F, [])))), .(region(e, E, .(B, .(C, .(F, [])))), .(region(f, F, .(C, .(D, .(E, [])))), []))))))).
map(west_europe, .(region(portugal, P, .(E, [])), .(region(spain, E, .(F, .(P, []))), .(region(france, F, .(E, .(I, .(S, .(B, .(WG, .(L, []))))))), .(region(belgium, B, .(F, .(H, .(L, .(WG, []))))), .(region(holland, H, .(B, .(WG, []))), .(region(west_germany, WG, .(F, .(A, .(S, .(H, .(B, .(L, []))))))), .(region(luxembourg, L, .(F, .(B, .(WG, [])))), .(region(italy, I, .(F, .(A, .(S, [])))), .(region(switzerland, S, .(F, .(I, .(A, .(WG, []))))), .(region(austria, A, .(I, .(S, .(WG, [])))), []))))))))))).
colors(X, .(red, .(yellow, .(blue, .(white, []))))).

Queries:

color_map(a,g).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
color_map_in: (f,b)
color_region_in: (f,b)
select_in: (f,b,f)
members_in: (f,b)
member_in: (f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(.(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X1, T)) → U8_AG(X, X1, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x5)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x5)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x5)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(.(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X1, T)) → U8_AG(X, X1, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x5)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x5)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x5)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 4 SCCs with 10 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(.(X1, T)) → MEMBER_IN_AG(T)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys)) at position [1] we obtained the following new rules:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ Instantiation
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U6_AG(Ys, member_out_ag(X)) → MEMBERS_IN_AG(Ys) we obtained the following new rules:

U6_AG(.(z0, z1), member_out_ag(z0)) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1)) → MEMBERS_IN_AG(.(z0, z1))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U6_AG(.(z0, z1), member_out_ag(z0)) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1)) → MEMBERS_IN_AG(.(z0, z1))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U6_AG(.(z0, z1), member_out_ag(z0)) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1)) → MEMBERS_IN_AG(.(z0, z1))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)


s = MEMBERS_IN_AG(.(x0, x1)) evaluates to t =MEMBERS_IN_AG(.(x0, x1))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

MEMBERS_IN_AG(.(x0, x1))U6_AG(.(x0, x1), member_out_ag(x0))
with rule MEMBERS_IN_AG(.(x0', x1')) → U6_AG(.(x0', x1'), member_out_ag(x0')) at position [] and matcher [x1' / x1, x0' / x0]

U6_AG(.(x0, x1), member_out_ag(x0))MEMBERS_IN_AG(.(x0, x1))
with rule U6_AG(.(z0, z1), member_out_ag(z0)) → MEMBERS_IN_AG(.(z0, z1))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(.(Y, Ys)) → SELECT_IN_AGA(Ys)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The argument filtering Pi contains the following mapping:
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors))

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(select_in_aga(Colors))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors)) at position [1] we obtained the following new rules:

COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(select_in_aga(Colors))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

color_region_in_ag(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X1, T)) → U8_ag(member_in_ag(T))
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))

The set Q consists of the following terms:

U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
color_map_in: (f,b)
color_region_in: (f,b)
select_in: (f,b,f)
members_in: (f,b)
member_in: (f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(.(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X1, T)) → U8_AG(X, X1, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x4, x5)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x3, x5)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x4, x5)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x2, x3, x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x3, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(.(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X1, T)) → U8_AG(X, X1, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x4, x5)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x3, x5)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x4, x5)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x2, x3, x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x3, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 4 SCCs with 10 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X1, T)) → MEMBER_IN_AG(X, T)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(.(X1, T)) → MEMBER_IN_AG(T)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys)) at position [1] we obtained the following new rules:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ Instantiation
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U6_AG(Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Ys) we obtained the following new rules:

U6_AG(.(z0, z1), member_out_ag(x1, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ NonTerminationProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))
U6_AG(.(z0, z1), member_out_ag(x1, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))
U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))
U6_AG(.(z0, z1), member_out_ag(x1, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))
U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))


s = MEMBERS_IN_AG(.(x0, x1')) evaluates to t =MEMBERS_IN_AG(.(x0, x1'))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

MEMBERS_IN_AG(.(x0, x1'))U6_AG(.(x0, x1'), member_out_ag(x0, .(x0, x1')))
with rule MEMBERS_IN_AG(.(x0', x1'')) → U6_AG(.(x0', x1''), member_out_ag(x0', .(x0', x1''))) at position [] and matcher [x1'' / x1', x0' / x0]

U6_AG(.(x0, x1'), member_out_ag(x0, .(x0, x1')))MEMBERS_IN_AG(.(x0, x1'))
with rule U6_AG(.(z0, z1), member_out_ag(x1, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(.(Y, Ys)) → SELECT_IN_AGA(Ys)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(.(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag([], Colors) → color_map_out_ag([], Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(.(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(.(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X1, T)) → U8_ag(X, X1, T, member_in_ag(X, T))
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X, X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The argument filtering Pi contains the following mapping:
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors))
U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(Colors, select_in_aga(Colors))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors)) at position [1] we obtained the following new rules:

COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
QDP
                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))
U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(Colors, select_in_aga(Colors))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))
U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

color_region_in_ag(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Narrowing
                          ↳ QDP
                            ↳ UsableRulesProof
                              ↳ QDP
                                ↳ QReductionProof
QDP

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X1, T)) → U8_ag(X1, T, member_in_ag(T))
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X1, T, member_out_ag(X, T)) → member_out_ag(X, .(X1, T))
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))

The set Q consists of the following terms:

U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.